package com.heihei.mymusic.util;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.heihei.mymusic.dto.CommonResponseDTO;
import com.heihei.mymusic.entity.MyMusic;
import com.heihei.mymusic.vo.MyMusicPageVo;
import com.heihei.mymusic.vo.PageVo;

/**
 * 用于分页相关的工具类
 */
public class PageUtil {
    public static Page getPage(PageVo pageVo){
        Page page = new Page();
        if(pageVo.getCurrentPage() == null) {
            page.setCurrent(1);
        } else {
            page.setCurrent(pageVo.getCurrentPage());
        }
        if(pageVo.getPageSize() == null) {
            page.setSize(10);
        } else {
            page.setSize(pageVo.getPageSize());
        }
        return page;
    }


}